@echo off
echo Starting MCP Greeting & Calculator Server...
echo.

REM 检查Python是否安装
python --version >nul 2>&1
if %errorlevel% neq 0 (
    echo Error: Python is not installed or not in PATH
    pause
    exit /b 1
)

REM 检查依赖是否安装
echo 检查并安装Python依赖...
pip show fastmcp >nul 2>&1
if %errorlevel% neq 0 (
    echo 安装FastMCP依赖...
    pip install -r requirements.txt
    if %errorlevel% neq 0 (
        echo 依赖安装失败！
        pause
        exit /b 1
    )
) else (
    echo FastMCP依赖已安装
)

echo Dependencies OK
echo.
echo Starting server...
echo Press Ctrl+C to stop the server
echo.

python server.py

echo.
echo Server stopped.
pause